package com.admin.dbdao;

import com.admin.bean.KeywordType;
import com.data.dbdao.BaseDao;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * 分辨率Dao
 *
 * @author:HingLo
 * @create 2017-09-11 15:36
 **/
@Repository
@Transactional
public class KeywordTypeDao extends BaseDao {

    /**
     * 查询数据中所有的版本信息
     *
     * @return
     */
    public List<KeywordType> findAllDao() {
        String hql = "from KeywordType";
        return (List<KeywordType>) super.findMassageDao(hql);
    }

    /**
     * 保存信息
     *
     * @param keywordType
     * @return
     */
    public boolean addkeywordTypeDao(KeywordType keywordType) {
        return super.saveMassageDao(keywordType);
    }

    /**
     * 删除版本信息
     *
     * @param id
     * @return
     */
    public boolean delkeywordTypeDao(String id) {
        String hql = "delete KeywordType where id=?";
        return super.updateManyMssageDao(hql, id) > 0;
    }

}
